package com.ethink.mdm.api.enums;

/**
 * 枚举 法定货币
 *
 * @Author: lzy
 * @Date: Created in 2022/12/8 14:53
 * ModifiedBy:
 * Version:
 */
public enum LegalCurrencyEnum {
    CNY("CNY", "人民币"),
    GBP("GBP", "英镑"),
    HKD("HKD", "港币"),
    USD("USD", "美元"),
    CHF("CHF", "瑞士法郎"),
    SGD("SGD", "新加坡元"),
    SEK("SEK", "瑞典克朗"),
    DKK("DKK", "丹麦克朗"),
    NOK("NOK", "挪威克朗"),
    JPY("JPY", "日元"),
    CAD("CAD", "加拿大元"),
    AUD("AUD", "澳大利亚元"),
    EUR("EUR", "欧元"),
    MOP("MOP", "澳门元"),
    PHP("PHP", "菲律宾比索"),
    THB("THB", "泰国铢"),
    NZD("NZD", "新西兰元"),
    KRW("KRW", "韩元"),
    RUB("RUB", "卢布"),
    MYR("MYR", "林吉特"),
    TWD("TWD", "新台币"),
    IDR("IDR", "印尼卢比"),
    BRL("BRL", "巴西里亚尔"),
    AED("AED", "阿联酋迪拉姆"),
    INR("INR", "印度卢比"),
    ZAR("ZAR", "南非兰特"),
    SAR("SAR", "沙特里亚尔"),
    TRY("TRY", "土耳其里拉")
    ;
    /**
     * 编码
     */
    private String code;

    /**
     * 名称
     */
    private String name;

    LegalCurrencyEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static LegalCurrencyEnum valueOfCode(String code) {
        for (LegalCurrencyEnum value : LegalCurrencyEnum.values()) {
            if(value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
